/*
 * @Descripttion: 说明
 * @version: V1.0
 * @Author: GaoWei
 * @Date: 2021-06-29 09:06:29
 * @LastEditors: GW
 * @LastEditTime: 2021-12-21 10:16:35
 */
import { axios } from '../../utils/request'

/**
 * 委外生产加工
 */
const api = {
    save: '/production/work/saveDelegateOrder',
    examine: '/production/work/examineDelegate',
    delete: '/production/work/deleteDelegateById',
    getcode: '/production/work/getDelegateCode',

    getDetails: '/production/work/listNotDispatchedDetail',
    getBomDetails: '/production/dispatch/listLeafDetailByMother',
    getClDetails: '/production/work/listByProductionWorkId',//获取委外加工单材料明细
}
/**
 * 保存
 */
export function save (data) {
    return axios({
        url: api.save,
        method: "post",
        data: data
    })
}

/**
 * 审核
 */
export function examine (data) {
    return axios({
        url: api.examine,
        method: "get",
        params: data
    })
}

/**
 * 删除
 */
export function remove (data) {
    return axios({
        url: api.delete,
        method: "DELETE",
        params: data
    })
}

/**
 * 获取单据编号
 */
export function getCode (data) {
    return axios({
        url: api.getcode,
        method: "get",
        params: data
    })
}

/**
 * 根据加工单ID 查询 未完工 产品明细
 */
export function getIdDetails (data) {
    return axios({
        url: api.getDetails,
        method: "get",
        params: data
    })
}

/**
 * 根据bomID获取尾阶 物料需求量
 */
export function getBomDetails (data) {
    return axios({
        url: api.getBomDetails,
        method: "get",
        params: data
    })
}

/**
 * 获取委外加工单材料明细
 */
export function getClDetails (data) {
    return axios({
        url: api.getClDetails,
        method: "get",
        params: data
    })
}

/**
 * 提交单据
 */
export function submitOrder (data) {
    return axios({
        url: '/production/work/submit',
        method: "get",
        params: data
    })
}

